package mall.bean;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

public class Product implements Serializable {

	private static final long serialVersionUID = 8931197808386342848L;

	private long pid;
	private long cid;
	private String title;
	private String sellPoint;
	private BigDecimal price;
	private String cover;
	private int stock;
	private String description;
	private java.util.Date createTime;
	private java.util.Date lastModifiedTime;
	private boolean onSale; // 数据库的任何类型都是可以为null的。但是java中的boolean允许为null吗？可是Boolean就允许为空！
	private java.util.Date onSaleTime;
	
	public Product() {
	}

	public Product(long pid, long cid, String title, String sellPoint, BigDecimal price, String cover, int stock,
			String description, Date createTime, Date lastModifiedTime, boolean onSale, Date onSaleTime) {
		super();
		this.pid = pid;
		this.cid = cid;
		this.title = title;
		this.sellPoint = sellPoint;
		this.price = price;
		this.cover = cover;
		this.stock = stock;
		this.description = description;
		this.createTime = createTime;
		this.lastModifiedTime = lastModifiedTime;
		this.onSale = onSale;
		this.onSaleTime = onSaleTime;
	}

	public long getPid() {
		return pid;
	}

	public void setPid(long pid) {
		this.pid = pid;
	}

	public long getCid() {
		return cid;
	}

	public void setCid(long cid) {
		this.cid = cid;
	}

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public String getSellPoint() {
		return sellPoint;
	}

	public void setSellPoint(String sellPoint) {
		this.sellPoint = sellPoint;
	}

	public BigDecimal getPrice() {
		return price;
	}

	public void setPrice(BigDecimal price) {
		this.price = price;
	}

	public String getCover() {
		return cover;
	}

	public void setCover(String cover) {
		this.cover = cover;
	}

	public int getStock() {
		return stock;
	}

	public void setStock(int stock) {
		this.stock = stock;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public Date getCreateTime() {
		return createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

	public Date getLastModifiedTime() {
		return lastModifiedTime;
	}

	public void setLastModifiedTime(Date lastModifiedTime) {
		this.lastModifiedTime = lastModifiedTime;
	}

	public boolean isOnSale() {
		return onSale;
	}

	public void setOnSale(boolean onSale) {
		this.onSale = onSale;
	}

	public Date getOnSaleTime() {
		return onSaleTime;
	}

	public void setOnSaleTime(Date onSaleTime) {
		this.onSaleTime = onSaleTime;
	}

	@Override
	public String toString() {
		return "Product [pid=" + pid + ", cid=" + cid + ", title=" + title + ", sellPoint=" + sellPoint + ", price="
				+ price + ", cover=" + cover + ", stock=" + stock + ", description=" + description + ", createTime="
				+ createTime + ", lastModifiedTime=" + lastModifiedTime + ", onSale=" + onSale + ", onSaleTime="
				+ onSaleTime + "]";
	}

}
